<?php
/**
 * Created by PhpStorm.
 * User: geyouwen
 * Date: 17/2/6
 * Time: 上午11:49
 */

namespace App\Model\Dao;


use Jenssegers\Mongodb\Eloquent\Model;

class User extends Model
{

    protected $connection = 'mongodb';

    protected $collection = 'member';




    public function register()
    {
        $data = [
            'username' => 'gywbank',
            'password' => uniqid(),
            'time'     => time()
        ];
        return  $this->insert($data);
    }

    public function getAll()
    {
        return  $this->all()->take(10);
    }

}